package com.crealth.job;

import java.sql.Date;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.List;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.crealth.db.StaffDayKPIDb;
import com.crealth.model.StaffDayKPIModel;

public class StaffDayKPIJob implements Job {

	@Override
	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		Date curd = new Date(System.currentTimeMillis());
		String strMonth = new SimpleDateFormat("yyyyMM").format(curd);
		String cdrTbName = "e_cdr_" + strMonth;
		String strDay = new SimpleDateFormat("yyyy-MM-dd").format(curd);		
		List<StaffDayKPIModel> kpils = StaffDayKPIDb.selectUserDayCall(cdrTbName, strDay);
		for (StaffDayKPIModel dayKpi : kpils) {
			Timestamp curDay = new Timestamp(curd.getTime());
			dayKpi.setCurDay(curDay);
			StaffDayKPIDb.insertUserDayCall(dayKpi);
		}
		
		//  提交的意向客户   没来的  回退
		
	}

}
